package com.onlinemeal.order.po;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.onlinemeal.meal.po.Meal;

@Entity
@Table(name="orderitem")
public class OrderItem implements Serializable{
	
	private static final long serialVersionUID = 3L;
	@Id
	private String item_id;
	private int count;
	private double subtotal;
	@ManyToOne(optional=false,fetch=FetchType.LAZY,targetEntity=Order.class)
	@JoinColumn(name="item_order_id" , nullable=false , updatable=false)
	private Order order;
	@ManyToOne(optional=false,fetch=FetchType.LAZY,targetEntity=Meal.class)
	@JoinColumn(name="item_meal_id" , nullable=false , updatable=false)
	private Meal meal;
	public String getItem_id() {
		return item_id;
	}
	public void setItem_id(String item_id) {
		this.item_id = item_id;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public double getSubtotal() {
		return subtotal;
	}
	public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}
	public Order getOrder() {
		return order;
	}
	public void setOrder(Order order) {
		this.order = order;
	}
	public Meal getMeal() {
		return meal;
	}
	public void setMeal(Meal meal) {
		this.meal = meal;
	}
	
}
